﻿import psutil

import datetime,psutil
print('开机时间：',datetime.datetime.fromtimestamp(psutil.boot_time()).strftime("%Y-%m-%d %H:%M:%S"))
print('当前用户：',psutil.users())
# for x in  psutil.process_iter():
	# print(x)
	
# print(psutil.net_if_addrs())
# print(psutil.disk_io_counters())
# print(psutil.disk_partitions())
# print(psutil.cpu_freq())
# print(psutil.cpu_count())

import wmi
c = wmi.WMI()
cpuid=''

for cpu in c.Win32_Processor():     
	cpuid = cpu.ProcessorId.strip()

print(cpuid)

def PrintDiskInfo():
    c = wmi.WMI()
    #cpu***
    for cpu in c.Win32_Processor():
        print( "cpu id:", cpu.ProcessorId.strip())
    #硬盘***
    for disk in c.Win32_DiskDrive():
        print( 'disk id:', disk.SerialNumber.strip())
    #主板***
    for board in c.Win32_BaseBoard():
        print( "main board id:", board.SerialNumber.strip())
    #mac地址
    for networkAdapter in c.Win32_NetworkAdapterConfiguration (IPEnabled = True):
        print( "mac address:", networkAdapter.MACAddress)
    #bios***
    for bios in c.Win32_BIOS():
        print( "bios number:", bios.SerialNumber.strip())

if __name__ == "__main__":
    PrintDiskInfo()